﻿<phone:PhoneApplicationPage 
    x:Class="SignalLab.Analyser"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Landscape" Orientation="Landscape"
    mc:Ignorable="d" d:DesignHeight="480" d:DesignWidth="728"
    shell:SystemTray.IsVisible="True"
    xmlns:me="clr-namespace:SignalLab"  xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
  >
  <phone:PhoneApplicationPage.Resources>
    <Storyboard x:Key="PulseLogo">
      <DoubleAnimation Storyboard.TargetName="IconScale" Storyboard.TargetProperty="ScaleX"
              From="1" To="1.7" Duration="0:0:0.500" RepeatBehavior="Forever" AutoReverse="True" />
      <DoubleAnimation Storyboard.TargetName="IconScale" Storyboard.TargetProperty="ScaleY"
              From="1" To="1.7" Duration="0:0:0.500" RepeatBehavior="Forever" AutoReverse="True" />
    </Storyboard>
  </phone:PhoneApplicationPage.Resources>
  

  <toolkit:TransitionService.NavigationInTransition>
    <toolkit:NavigationInTransition>
      <toolkit:NavigationInTransition.Backward>
        <toolkit:TurnstileTransition Mode="BackwardIn"/>
      </toolkit:NavigationInTransition.Backward>
      <toolkit:NavigationInTransition.Forward>
        <toolkit:TurnstileTransition Mode="ForwardIn"/>
      </toolkit:NavigationInTransition.Forward>
    </toolkit:NavigationInTransition>
  </toolkit:TransitionService.NavigationInTransition>
  <toolkit:TransitionService.NavigationOutTransition>
    <toolkit:NavigationOutTransition>
      <toolkit:NavigationOutTransition.Backward>
        <toolkit:TurnstileTransition Mode="BackwardOut"/>
      </toolkit:NavigationOutTransition.Backward>
      <toolkit:NavigationOutTransition.Forward>
        <toolkit:TurnstileTransition Mode="ForwardOut"/>
      </toolkit:NavigationOutTransition.Forward>
    </toolkit:NavigationOutTransition>
  </toolkit:TransitionService.NavigationOutTransition>


  <Grid x:Name="LayoutRoot">
    <Grid.Background>
      <ImageBrush ImageSource="/SignalLab;component/background_record.jpg" Stretch="UniformToFill" />
    </Grid.Background>
    <Grid.RowDefinitions>
      <RowDefinition Height="Auto"/>
      <RowDefinition Height="*"/>
    </Grid.RowDefinitions>

    <!--TitlePanel contains the name of the application and page title-->
    <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
      <TextBlock x:Name="ApplicationTitle" Text="SignalLab Mobile by Daniel Turan" Style="{StaticResource PhoneTextNormalStyle}"/>
      <TextBlock x:Name="PageTitle" Text="Signal Recording" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}">
        <TextBlock.Foreground>
          <ImageBrush ImageSource="/SignalLab;component/Styles/cropped-705197_f5203.jpg" Stretch="Uniform" />
        </TextBlock.Foreground>
      </TextBlock>
    </StackPanel>
    <Image Name="icon" Source="/ApplicationIcon.png" Stretch="None" HorizontalAlignment="Right" Margin="30,0"
           RenderTransformOrigin="0.5,0.5"
           >
      <Image.RenderTransform>
        <ScaleTransform x:Name="IconScale"  />
      </Image.RenderTransform>
    </Image>

    <!--ContentPanel - place additional content here-->
    <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
      <Grid.RowDefinitions>
        <RowDefinition Height="Auto" />
        <RowDefinition Height="*" />
      </Grid.RowDefinitions>
      <StackPanel Orientation="Horizontal" >
        <ToggleButton Content="Start" me:Attached.CheckedContent="Stop" Width="150" HorizontalAlignment="Left" VerticalAlignment="Top" Checked="ToggleButton_Checked" Unchecked="ToggleButton_Unchecked" />
        <TextBlock Text="Gain:" VerticalAlignment="Center"/>
        <TextBox  VerticalAlignment="Center" Width="100" >
          <TextBox.InputScope>
            <InputScope>
              <InputScopeName NameValue="Digits" />
            </InputScope>
          </TextBox.InputScope>
        </TextBox>
        <TextBlock Text="Top limit:" VerticalAlignment="Center"/>
        <TextBox   VerticalAlignment="Center" Width="100">
          <TextBox.InputScope>
            <InputScope>
              <InputScopeName NameValue="Digits" />
            </InputScope>
          </TextBox.InputScope>
        </TextBox>
        <TextBlock Text="Bottom limit:" VerticalAlignment="Center"/>
        <TextBox  VerticalAlignment="Center" Width="100" >
          <TextBox.InputScope>
            <InputScope>
              <InputScopeName NameValue="Digits" />
            </InputScope>
          </TextBox.InputScope>

        </TextBox>
      </StackPanel>
      
      <Image Name="visualiserImg" Grid.Row="1" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Source="/SignalLab;component/Styles/cropped-705197_f5203.jpg" />

      <ItemsControl ItemsSource="{Binding Properties}" HorizontalAlignment="Left" Grid.Row="1">
        <ItemsControl.ItemTemplate>
          <DataTemplate>
            <StackPanel Orientation="Horizontal">
              <TextBlock Text="{Binding Name}" />
              <TextBlock Text=": "/>
              <TextBlock Text="{Binding FormattedValue}" />
            </StackPanel>
          </DataTemplate>
        </ItemsControl.ItemTemplate>
      </ItemsControl>
    </Grid>
  </Grid>

</phone:PhoneApplicationPage>
